package cn.platform.controller;

import cn.platform.response.AResponse;
import cn.platform.service.HarmonyService;
import cn.platform.service.HarmonyTeacherService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@CrossOrigin(maxAge = 3600) //允许跨域请求
@Controller
@RequestMapping("/api/harmony-teacher")
public class HarmonyTeacherController {
    @Resource
    HarmonyTeacherService harmonyTeacherService;

    /**
     * 根据老师id查询老师信息
     *
     * @param id 老师id
     * @return AResponse res 老师的信息
     *
     * @author jyz
     */
    @GetMapping("/get-role/{id}")
    @ResponseBody
    public AResponse getRoleMessage(@PathVariable Integer id){
        return harmonyTeacherService.getRoleMessage(id);
    }

    /**
     * 根据老师id查询所教班级
     *
     * @param id 老师id
     * @return AResponse res 老师的信息
     *
     * @author jyz
     */
    @GetMapping("/get-role-message/{id}")
    @ResponseBody
    public AResponse getTeacherClass(@PathVariable Integer id){
        return harmonyTeacherService.getTeacherClass(id);
    }
}
